const axios = require('axios')
let baiduAccesstoken = "24.2a1587a9e7617c41e3bbf6e2a0504e64.2592000.1719539008.282335-73632829";
// res.data.result
function getChatResult(text) {
  return axios
  .post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/yi_34b_chat?access_token='+baiduAccesstoken, {
    "messages": [
        {
            "role": "user",
            "content": "请将这个句子用英文输出，并解释语法: "+text
        }
    ]
})  
}
module.exports.getChatResult = getChatResult